package com.itheima;

import java.util.LinkedList;

/**
 * @ProjectName: shixun DaErXia
 * @Titile: LinkedListDemo
 * @Author: 雨
 * @Description: TODO
 */
public class LinkedListDemo {
    public static void main(String[] args) {
        LinkedList<String> list=new LinkedList<>();
        list.addFirst("张三");
        list.addLast("李四");
        list.addLast("王五");
        list.addLast("赵六");
        list.addLast("钱七");

        String first=list.getFirst();
        System.out.println(first);
        String last=list.getLast();
        System.out.println(last);

        String removeFirst=list.removeFirst();
        System.out.println(removeFirst);
        String removeLast=list.removeLast();
        System.out.println(removeLast);

        System.out.println(list);

    }
}
